""" Models/Services Model """

from masoniteorm.models import Model

from config.config import cache


class Services(Model):
    """Models/Services Model"""
    __fillable__ = ['name_zh', 'is_menu', 'name_ug', 'images', 'description', 'vip_benefit', 'cid']
    __hidden__ = ['name_zh','name_ug']
    __appends__ = ['name']


    def get_name_attribute(self):
        lan = cache.get('lan')
        if lan == 'ug':
            return self.name_ug
        return self.name_zh